package com.wjggy.core.service.posts.Impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.wjggy.core.common.dbtools.DaoUtils;
import com.wjggy.core.entities.Category;
import com.wjggy.core.entities.Forums;
import com.wjggy.core.service.posts.CategoryService;


 /**
 *  <p>Description:  </p>
 *  <p>Copyright:Copyright (c) 2012  </p>
 *  <p>Company:wjggy  </p>
 *  @author xiaofan.yu  
 *  @date   2012-2-3 下午06:47:24    
 *  @project  wjggy
 *  @version  1.0.0
 *  @see   
 *  @since 1.6 
 */
@Service("categoryService")
public class CategoryServiceImpl implements CategoryService {
	private static final Logger log = Logger.getLogger(CategoryServiceImpl.class);
	@Resource(name="daoUtils")
	private DaoUtils daoUtils;
	@Override
	public List<Category> findCategory(Category category) {
		return 	daoUtils.findAll("category.queryAll", category);
	}
	@Override
	public boolean addCategory(Category category) {
		daoUtils.add("category.insert", category);
		return false;
	}
	@Override
	public boolean deleteCategory(Category category) {
		daoUtils.delete("category.delete", category);
		return false;
	}
	@Override
	public boolean updateCategory(Category category) {
		daoUtils.update("category.update", category);
		return false;
	}
	@Override
	public Category getCategory(Long categoryid){
		return (Category) daoUtils.findObject("category.queryByID", categoryid);
	}
}

